<?php
//模型
class homeModel extends MY_Model {
	function __construct(){
		parent::__construct();
		$this->table = 'cashiers';
		$this->totals = array();
	}

	//获取结账表的数据
	function get_cash_balance($month){
		$this->db->select('money');
		$this->db->where('date_month',$month);
		$query = $this->db->get($this->db->dbprefix.'cash_balance');
		$list = $query->row_array();
		return $list;
	}

	function get_all($arr){
		
		$this->db->select('id,date_month,type,mtype,money');

		if(isset($arr['date_month']) && !empty($arr['date_month'])){
			$this->db->where('date_month',$arr['date_month']);
		}
		$this->db->order_by('id','asc');

		$query = $this->db->get($this->db->dbprefix.$this->table);
		$list = $query->result_array();
		return $list;
	}

}
?>